#include "VPushButton.h"

VTestButton::VTestButton(void) :
    _degree(0)
{
}

VTestButton::~VTestButton(void)
{
}

bool VTestButton::render() const
{
    if (!VRRWidget::render())
    {
        return false;
    }

    static GLfloat _points[3][4] =
    {
        0,  0,  0,
        _w, 0,  0,
        0, _h,  0,
        _w, _h,  0
    };
    static GLfloat _colors[3][4] =
    {
        1, 0, 1,
        1, 1, 0,
        0, 1, 1,
        1, 0, 0
    };

    // glRotatef(_degree, 0.2f, 0.3f, 1.0f);

    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_COLOR_ARRAY);

    glVertexPointer(3, GL_FLOAT, 0, _points);
    glColorPointer(3, GL_FLOAT, 0, _colors);

    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_COLOR_ARRAY);

    return true;
}
